package com.xzdream.spark.WordCount

import org.apache.spark.{SparkConf, SparkContext}

object Main {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf()
    sparkConf.setAppName("LogApp").setMaster("local[2]")
    val sc = new SparkContext(sparkConf)

    val textFile = sc.textFile("file:///Users/zhudechao/gitee/spark/spark-demo/data/input/test.txt")
    val wc = textFile.flatMap(line=>line.split("\t"))
        .map((_,1)).reduceByKey(_+_)
        //.collect.foreach(println)
    wc.saveAsTextFile("")

    sc.stop()
  }
}
